
<form class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/matantiguo/procesar" ?>" method="post">
    <legend>MATRICULACION DE SEGUNDO CICLO EN ADELANTE</legend>

    <div class="control-group">
        <label class="control-label" for="select01">PERIODO ACTUAL</label>
        <div class="controls ">
            <select name="ide_lec" class="span3">
                <?php
                foreach ($periodos as $i => $per) {
                    echo ("<option value='" . $per["ide_lec"] . "'>");
                    echo ($per["descripcion_lec"] . "</option>");
                }
                ?>
            </select>

        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="select03">CARRERAS</label>
        <div class="controls ">
            <select name="ide_car" class="span3" autofocus
                    ONCHANGE="javascript:enviar(this.options[this.selectedIndex].value, '<?php echo (base_url()) . "admin.php/matantiguo/crear" ?>');">
                        <?php
                        foreach ($carrera as $i => $car) {
                            if ($ide_car == $car["ide_car"]) {
                                echo ("<option value='" . $car["ide_car"] . "'");
                                echo (($ide_car == $car["ide_car"] ? " selected" : "") . ">");
                                echo ($car["nombre_car"] . "</option>");
                            }
                        }
                        ?>
            </select>

        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="select03">Lista de Pensums</label>
        <div class="controls ">
            <select id="select02" name="ide_pen" class="span3">

                <?php
                foreach ($pensum as $i => $pen) {
                    if ($ide_pen == $pen["ide_pen"]) {
                        echo ("<option value='" . $pen["ide_pen"] . "'");
                        echo (($ide_pen == $pen["ide_pen"] ? " selected" : "") . ">");
                        echo ($pen["descripcion_pen"] . "-" . $pen["estado_pen"] . "</option>");
                    }
                }
                ?>

            </select>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="select04">Ciclo Anterior</label>
        <div class="controls ">
            <select id="codigo_cic"  name="codigo_cic_ant" class="span3" disabled>
<?php
foreach ($ciclo as $i => $cic) {
    if ($codigo_cic == $cic["ide_cic"]) {
        echo ("<option value='" . $cic["ide_cic"] . "'");
        echo (($codigo_cic == $cic["ide_cic"] ? " selected" : "") . ">");
        echo ($cic["codigo_cic"] . "-" . $cic["nombre_cic"] . "</option>");
    }
}
?>

            </select>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="select04">Ciclo Actual</label>
        <div class="controls ">
            <select id="codigo_cic"  name="codigo_cic" class="span3" >
<?php
if ($modo_mat_ant == '1') {
    foreach ($ciclo as $i => $cic) {
        if ($codigo_cic <= $cic["ide_cic"]) {
            echo ("<option value='" . $cic["ide_cic"] . "'");
            echo (($codigo_cic == $cic["ide_cic"] ? " selected" : "") . ">");
            echo ($cic["codigo_cic"] . "-" . $cic["nombre_cic"] . "</option>");
        }
    }
}else {
            foreach ($ciclo as $i => $cic) {
                echo ("<option value='" . $cic["ide_cic"] . "'");
                echo (($codigo_cic == $cic["ide_cic"] ? " selected" : "") . ">");
                echo ($cic["codigo_cic"] . "-" . $cic["nombre_cic"] . "</option>");
            }
        }
    
    ?>

                </select>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="select02">JORNADA DE TRABAJO</label>
            <div class="controls ">
                <select name="seccion" class="span3">
                    <option value="1"  <?php echo (($seccion == 1 ? " selected" : " ")); ?>>DIURNO </option>
                    <option value="2"  <?php echo (($seccion == 2 ? " selected" : " ")); ?>> NOCTURNO</option>
                    <option value="3" <?php echo (($seccion == 3 ? " selected" : " ")); ?>>FINES DE SEMANA</option>

                </select>


            </div>
        </div>

        <table border="0">
            <thead>
                <tr>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <div class="control-group">
                            <label class="control-label" for="select03">PARALELO</label>
                            <div class="controls ">
                                <select name="paralelo" class="span1">
                                    <option value="A"  <?php echo (($paralelo == 'A' ? " selected" : " ")); ?>>A</option>
                                    <option value="B"  <?php echo (($paralelo == 'B' ? " selected" : " ")); ?>>B</option>
                                    <option value="C" <?php echo (($paralelo == 'C' ? " selected" : " ")); ?>>C</option>

                                </select>


                            </div>
                        </div>  
                    </td>
                    <td>
                        <div class="control-group">
                            <label class="control-label" for="select04">ESTUDIANTES</label>
                            <div class="controls ">
                                <select name="cod_est" class="span3">
    <?php
    if ($paralelo == -1)
        echo ("<option value='-1' selected>Seleccionar</option>");

    foreach ($estudiantes as $l => $est) {
        echo ("<option value='" . $est["persona_ide_pers"] . "'>");
        echo ($est["apellido_pers"] . " " . $est["nombre_pers"] . "</option>");
    }
    ?>
                                </select>


                            </div>
                        </div> 
                    </td>
                </tr>
            </tbody>
        </table>

        <div class="control-group">
            <label class="control-label" for="select02">MODO DE MATRICULA ANTERIOR</label>
            <div class="controls ">
                <select name="modo_mat_ant" class="span2" disabled>
                    <option value="1" <?php echo (($modo_mat_ant == '1' ? " selected" : " ")); ?>>NORMAL</option>
                    <option value="2" <?php echo (($modo_mat_ant == '2' ? " selected" : " ")); ?>>NORMAL/ARRASTRE</option>
                    <option value="3" <?php echo (($modo_mat_ant == '3' ? " selected" : " ")); ?>>CONVALIDACION</option>
                    <option value="4" <?php echo (($modo_mat_ant == '4' ? " selected" : " ")); ?>>ARRASTRES</option>
                    <option value="5" <?php echo (($modo_mat_ant == '5' ? " selected" : " ")); ?>>POR MATERIAS</option>

                </select>

            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="select02">MODO DE MATRICULA</label>
            <div class="controls ">
                <select name="modo_mat" class="span2">
                    <option value="1" <?php echo (($modo_mat_ant == '1' ? " selected" : " ")); ?>>NORMAL</option>
                    <option value="2" <?php echo (($modo_mat_ant == '2' ? " selected" : " ")); ?>>NORMAL/ARRASTRE</option>
                    <option value="3" <?php echo (($modo_mat_ant == '3' ? " selected" : " ")); ?>>CONVALIDACION</option>
                    <option value="4" <?php echo (($modo_mat_ant == '4' ? " selected" : " ")); ?>>ARRASTRES</option>
                    <option value="5" <?php echo (($modo_mat_ant == '5' ? " selected" : " ")); ?>>POR MATERIAS</option>

                </select>

                <a href="<?php echo base_url() . "admin.php/estudiante/crear" ?>">
                    <span class="label label-info">EXPEDIENTE</span></a>


            </div>
        </div>



        <div class="controls">

            <button type="submit" class="btn"  <?php echo (($paralelo == -1 || $seccion == -1) ? "disabled " : " "); ?>>Iniciar Proceso</button>
            <a href="<?php echo base_url() . "admin.php/matantiguo/inicio" ?>">
                <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>
    </div>



</form>




